/**
 * 延时任务
 * @param {} fn
 * @param {} scope
 * @param {} args
 */
Fw.util.DelayedTask = function(fn, scope, args){
    var me = this, id;
    var call = function(){
		clearInterval(id);
        id = null;
        fn.apply(scope, args || []);
    };
    me.delay = function(delay, newFn, newScope, newArgs){
        me.cancel();
        fn = newFn || fn;
        scope = newScope || scope;
        args = newArgs || args;
        id = setInterval(call, delay);
    };
    me.cancel = function(){
        if(id){
            clearInterval(id);
            id = null;
        }
    };
};